package Utils;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;

public class FileUtils {

	public void writeFile(String srcPath, String desPath){
		 
		FileInputStream stream;
		FileOutputStream outputStream;
		try {
			stream = new FileInputStream(new File(srcPath));
			outputStream = new FileOutputStream(new File(desPath));
			byte[] bytes = new byte[1024];
			try {
				while(stream.read(bytes)!= -1)
					outputStream.write(bytes);
				outputStream.flush(); 
			} catch (IOException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}finally{
				try {
					stream.close();
					outputStream.close();
				} catch (IOException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				}
				
			}
			 
			
		} catch (FileNotFoundException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
}
